package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: ysotirov
 * Date: 30/01/13
 * Time: 18:48
 * To change this template use File | Settings | File Templates.
 */
public class BooksMenu extends Menu {
    ArrayList<IMenu> booksMenuOptions;

    public BooksMenu(IOInterface ioHndl,Biblioteca bibl){
        super(ioHndl,bibl);
        OptionList.add("1. Display list of books");
        OptionList.add("2. Reserve a book for collection");
        OptionList.add("3. Go back to Main Menu");
        booksMenuOptions = new ArrayList<IMenu>();
        booksMenuOptions.add(new DisplayBooksList(ioHndl,bibl));
        booksMenuOptions.add(new ReserveBookForCollection(ioHndl,bibl));
        booksMenuOptions.add(new GoBackToMain(ioHndl,bibl));
        titleMsg = "Books Menu";
        selectOptionMsg = "Please select one of the above options";
    }

    @Override
    public void executeOption(int opt) {
        booksMenuOptions.get(opt-1).executeOption();
    }
}
